#include <stdio.h>

int posX[100] = {0};
int posY[100] = {0};

int main()
{
	freopen("circle.in",  "r", stdin);
	freopen("circle.out", "w", stdout);
	int n = 0, r = 0;
	scanf("%d %d", &n, &r);
	for ( int i = 0; i < n; i++ ) {
		scanf("%d %d", &posX[i], &posY[i]);
	}
	
	int cnt = 0;
	for ( int i = 0; i < n-1; i++ )
	{
		for ( int j = i+1; j < n; j++ ) 
		{
			long long d = (long long)(posX[i] - posX[j]) * (posX[i] - posX[j]);
			d += (long long)(posY[i] - posY[j]) * (posY[i] - posY[j]);
			d = d - 4*(long long)r * r;
			if ( d < 0 ) {
				cnt ++;
			}
		}
	}
	printf("%d", cnt);
	fclose(stdin);
	fclose(stdout);
    return 0;
}
